home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
shells
/
kiss-0.11
/
kiss-0
/
kiss
/
src
/
morefile.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-23
|
586b
|
36 lines
#include "kiss.h"
int morefile (FILE *f, char *name, int showname, FILE *mystdin)
{
register int
ch,
lines = 0;
if (showname)
printf ("--------- %s --------\n", name);
while (1)
{
ch = fgetc (f);
if (feof (f))
{
printf ("more: q=quit, n=next file: ");
return (getinput (mystdin) != 'q');
}
putchar (ch);
if (ch == '\n')
{
if (++lines >= 23)
{
printf ("more: q=quit, n=next file, enter=next page: ");
if ( (ch = getinput (mystdin)) == 'q')
return (0);
else if (ch == 'n')
return (1);
lines = 0;
}
}
}
}